<html>
<title>axios</title>

<head>
    <script src="./js/vue.js"></script>
    <script src="./js/axios.js"></script>
    <script>
        window.onload = function () {
            let app = new Vue({
                el: '.container',
                data: {
                    projectForm: {
                        id: "617918764435603456",
                        name: "中台新name",
                        description: "中台新描述1"
                    }
                },
                methods: {
                    send() {
                        axios({
                            method: "get",
                            url: "http://127.0.0.1:9900/avatar/dashboard/api/v1/createtime/statistics"
                        }).then(function (reps) { //请求成功
                            console.log(reps.data);
                        }).catch(//请求失败
                            resp => {
                                console.log("请求失败：" + resp.status + ',' + resp.statusText);
                            }
                        );
                    },
                    send2() {
                        axios.get("http://127.0.0.1:9900/avatar/dashboard/api/v1/createtime/statistics")
                            .then(resp => {
                                console.log(resp.data);
                            }).catch(//请求失败
                                resp => {
                                    console.log("请求失败：" + resp.status + ',' + resp.statusText);
                                }
                            );
                    },
                    createItem() {
                        const project = {
                            id: this.projectForm.id,
                            name: this.projectForm.name,
                            description: this.projectForm.description
                        }
                        axios.put("http://192.168.35.29:9899/avatar/item-group/api/v1/update/base/info",
                            project
                        ).then(resp => {
                            console.log(resp.data);
                        })
                    }
                },
                filters: {

                }
            })
        }
    </script>
</head>

<body>
    <div class="container">
        <button @click="send">点击一下</button>
        <button @click="send2">点击一下2</button>
        <button @click="createItem">创建项目组</button>
    </div>
</body>

</html>